using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using Castle.ActiveRecord;
using Castle.ActiveRecord.Queries;


#region 'M_LOGIN_USER' Schema
/*
 * 'MLoginUser' class maps to 'M_LOGIN_USER' table.
 * 	 USERID                  | Type:NVARCHAR2 | Len:20    | Nullable:F | PK:T | FK:F
 * 	 COMPANYID               | Type:NVARCHAR2 | Len:20    | Nullable:T | PK:F | FK:F
 * 	 PASSWORD                | Type:NVARCHAR2 | Len:50    | Nullable:T | PK:F | FK:F
 * 	 USERNAME                | Type:NVARCHAR2 | Len:20    | Nullable:T | PK:F | FK:F
 * 	 NAMEPINYIN              | Type:NVARCHAR2 | Len:20    | Nullable:T | PK:F | FK:F
 * 	 USERTYPE                | Type:NVARCHAR2 | Len:1     | Nullable:T | PK:F | FK:F
 * 	 MAPPINGID               | Type:NVARCHAR2 | Len:20    | Nullable:T | PK:F | FK:F
 * 	 CREATEDATETIME          | Type:TIMESTAMP | Len:0     | Nullable:T | PK:F | FK:F
 * 	 CREATEUSERID            | Type:NVARCHAR2 | Len:20    | Nullable:T | PK:F | FK:F
 * 	 UPDATEDATETIME          | Type:TIMESTAMP | Len:0     | Nullable:T | PK:F | FK:F
 * 	 UPDATEUSERID            | Type:NVARCHAR2 | Len:20    | Nullable:T | PK:F | FK:F
 * 	 ROWUPDATEID             | Type:NVARCHAR2 | Len:36    | Nullable:T | PK:F | FK:F
 * 	 DELETEFLAG              | Type:NVARCHAR2 | Len:1     | Nullable:T | PK:F | FK:F
 * 	 PASSWORDUPDATEDATETIME  | Type:TIMESTAMP | Len:0     | Nullable:T | PK:F | FK:F
 * 	 TEMPPASSWORDFLAG        | Type:NVARCHAR2 | Len:1     | Nullable:T | PK:F | FK:F
 * 	 LOCKFLAG                | Type:NVARCHAR2 | Len:1     | Nullable:T | PK:F | FK:F
 */
#endregion
/// <summary>
///	Generated by MyGeneration using the ActiveRecord Object Mapper - 1.0.2
///	Created on 2011/9/9 0:15:42
/// </summary>
namespace Com.GainWinSoft.ERP.Entity
{
	[Serializable , ActiveRecord("M_LOGIN_USER")]
	public class MLoginUser : ActiveRecordBase	{

		#region Private Members

		private string userid; 
		private string companyid; 
		private string password; 
		private string username; 
		private string namepinyin; 
		private string usertype; 
		private string mappingid; 
		private DateTime createdatetime; 
		private string createuserid; 
		private DateTime updatedatetime; 
		private string updateuserid; 
		private string rowupdateid; 
		private string deleteflag; 
		private DateTime passwordupdatedatetime; 
		private string temppasswordflag; 
		private string lockflag; 
		
		#endregion

		#region Constuctor(s)
		
		public MLoginUser()
		{
			userid = String.Empty; 
			companyid = String.Empty; 
			password = String.Empty; 
			username = String.Empty; 
			namepinyin = String.Empty; 
			usertype = String.Empty; 
			mappingid = String.Empty; 
			createdatetime = DateTime.MinValue; 
			createuserid = String.Empty; 
			updatedatetime = DateTime.MinValue; 
			updateuserid = String.Empty; 
			rowupdateid = String.Empty; 
			deleteflag = String.Empty; 
			passwordupdatedatetime = DateTime.MinValue; 
			temppasswordflag = String.Empty; 
			lockflag = String.Empty; 

		}

		public MLoginUser(
			string _userid)
			: this()
		{
			userid = _userid;
			companyid = String.Empty;
			password = String.Empty;
			username = String.Empty;
			namepinyin = String.Empty;
			usertype = String.Empty;
			mappingid = String.Empty;
			createdatetime = DateTime.MinValue;
			createuserid = String.Empty;
			updatedatetime = DateTime.MinValue;
			updateuserid = String.Empty;
			rowupdateid = String.Empty;
			deleteflag = String.Empty;
			passwordupdatedatetime = DateTime.MinValue;
			temppasswordflag = String.Empty;
			lockflag = String.Empty;
		}

		#endregion // End of Class Constuctor(s)
		
		#region Public Properties
			
		[PrimaryKey(PrimaryKeyType.Identity ,"USERID", Length=20)]
		public virtual string Userid
		{
			get { return userid; }
			set { userid = value; }
		}

		[Property(Column="COMPANYID", Length=20)]
		public virtual string Companyid
		{
			get { return companyid; }
			set { companyid = value; }
		}

		[Property(Column="PASSWORD", Length=50)]
		public virtual string Password
		{
			get { return password; }
			set { password = value; }
		}

		[Property(Column="USERNAME", Length=20)]
		public virtual string Username
		{
			get { return username; }
			set { username = value; }
		}

		[Property(Column="NAMEPINYIN", Length=20)]
		public virtual string Namepinyin
		{
			get { return namepinyin; }
			set { namepinyin = value; }
		}

		[Property(Column="USERTYPE", Length=1)]
		public virtual string Usertype
		{
			get { return usertype; }
			set { usertype = value; }
		}

		[Property(Column="MAPPINGID", Length=20)]
		public virtual string Mappingid
		{
			get { return mappingid; }
			set { mappingid = value; }
		}

		[Property(Column="CREATEDATETIME")]
		public virtual DateTime Createdatetime
		{
			get { return createdatetime; }
			set { createdatetime = value; }
		}

		[Property(Column="CREATEUSERID", Length=20)]
		public virtual string Createuserid
		{
			get { return createuserid; }
			set { createuserid = value; }
		}

		[Property(Column="UPDATEDATETIME")]
		public virtual DateTime Updatedatetime
		{
			get { return updatedatetime; }
			set { updatedatetime = value; }
		}

		[Property(Column="UPDATEUSERID", Length=20)]
		public virtual string Updateuserid
		{
			get { return updateuserid; }
			set { updateuserid = value; }
		}

		[Property(Column="ROWUPDATEID", Length=36)]
		public virtual string Rowupdateid
		{
			get { return rowupdateid; }
			set { rowupdateid = value; }
		}

		[Property(Column="DELETEFLAG", Length=1)]
		public virtual string Deleteflag
		{
			get { return deleteflag; }
			set { deleteflag = value; }
		}

		[Property(Column="PASSWORDUPDATEDATETIME")]
		public virtual DateTime Passwordupdatedatetime
		{
			get { return passwordupdatedatetime; }
			set { passwordupdatedatetime = value; }
		}

		[Property(Column="TEMPPASSWORDFLAG", Length=1)]
		public virtual string Temppasswordflag
		{
			get { return temppasswordflag; }
			set { temppasswordflag = value; }
		}

		[Property(Column="LOCKFLAG", Length=1)]
		public virtual string Lockflag
		{
			get { return lockflag; }
			set { lockflag = value; }
		}


		#endregion 

			
		#region Equals, HashCode and ToString overrides
		
		/// <summary>
		/// Local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			if( ( obj == null ) || ( obj.GetType() != this.GetType() ) ) return false;
			MLoginUser castObj = (MLoginUser)obj; 
			return ( castObj != null ) &&
				( this.userid == castObj.Userid );
		}
		
		/// <summary>
		/// Local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
			
			int hash = 57; 
			hash = 27 * hash * userid.GetHashCode();
			return hash; 
		}
		
		/// <summary>
		/// Local implementation of ToString based on class members
		/// </summary>
		public override String ToString()
        {
            StringBuilder sbuffer = new StringBuilder();
			sbuffer.Append("{");
			
			sbuffer.AppendFormat("Userid = {0}, ",userid);
			sbuffer.AppendFormat("Companyid = {0}, ",companyid);
			sbuffer.AppendFormat("Password = {0}, ",password);
			sbuffer.AppendFormat("Username = {0}, ",username);
			sbuffer.AppendFormat("Namepinyin = {0}, ",namepinyin);
			sbuffer.AppendFormat("Usertype = {0}, ",usertype);
			sbuffer.AppendFormat("Mappingid = {0}, ",mappingid);
			sbuffer.AppendFormat("Createdatetime = {0}, ",createdatetime);
			sbuffer.AppendFormat("Createuserid = {0}, ",createuserid);
			sbuffer.AppendFormat("Updatedatetime = {0}, ",updatedatetime);
			sbuffer.AppendFormat("Updateuserid = {0}, ",updateuserid);
			sbuffer.AppendFormat("Rowupdateid = {0}, ",rowupdateid);
			sbuffer.AppendFormat("Deleteflag = {0}, ",deleteflag);
			sbuffer.AppendFormat("Passwordupdatedatetime = {0}, ",passwordupdatedatetime);
			sbuffer.AppendFormat("Temppasswordflag = {0}, ",temppasswordflag);
			sbuffer.AppendFormat("Lockflag = {0}, ",lockflag);
			sbuffer.Append(" }");
			return sbuffer.ToString();
        }
		
		#endregion
	}
}
